package com.shunwang.tools.httpclientsupport.client;

import java.net.URLEncoder;

public class HttpClientInfo {

	private int timeout;
	private String host;
	private int port;
	private String path;
	private String protocol = "http";
	private String url;
	private String encode = "UTF-8";
	
	
	
	@Override
	public String toString() {
		return url;
	}

	public HttpClientInfo(String host,String path,int port,int timeout,String encode){
		this.host = host;
		this.path = path;
		this.port = port;
		this.timeout = timeout;
		this.url = protocol+"://"+host+":"+port+"/"+path;
		if(encode != null){
			this.encode = encode;
		}
	}
	
	public HttpClientInfo(String host){
		this(host,"",80,30000,null);
	}
	
	public HttpClientInfo(String host,int port){
		this(host,"",port,30000,null);
	}
	
	public HttpClientInfo(String host,String path){
		this(host,path,80,30000,null);
	}
	
	public HttpClientInfo(String host,String path,int port){
		this(host,path,80,30000,null);
	}
	public HttpClientInfo(String host,String path,int port,String encode){
		this(host,path,80,30000,encode);
	}

	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getEncode() {
		return encode;
	}

	public void setEncode(String encode) {
		this.encode = encode;
	}
	
	
}
